<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>Reference</title>
    <link rel="stylesheet" href="../luadoc.css" type="text/css" />
	<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
</head>

<body>
<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->

<div id="main">

<div id="navigation">


<h1>LuaDoc</h1>
<ul>
	
	<li><a href="../index.html">Index</a></li>
	
</ul>


<!-- Module list -->



<!-- File list -->

<h1>Files</h1>
<ul>

	<li>
		<a href="../files/lime-map.html">lime-map.lua</a>
	</li>

	<li>
		<a href="../files/lime-object.html">lime-object.lua</a>
	</li>

	<li>
		<a href="../files/lime-objectLayer.html">lime-objectLayer.lua</a>
	</li>

	<li>
		<a href="../files/lime-property.html">lime-property.lua</a>
	</li>

	<li>
		<a href="../files/lime-tile.html">lime-tile.lua</a>
	</li>

	<li>
		<a href="../files/lime-tileLayer.html">lime-tileLayer.lua</a>
	</li>

	<li>
		<a href="../files/lime-tileset.html">lime-tileset.lua</a>
	</li>

	<li><strong>lime-utils.lua</strong></li>
	
	<li>
		<a href="../files/lime.html">lime.lua</a>
	</li>

</ul>






</div> <!-- id="navigation" -->

<div id="content">

<h1>File <code>lime-utils.lua</code></h1>


<p>A list of utility functions provided as part of Lime.</p>






<h2>Functions</h2>
<table class="function_list">

	<tr>
	<td class="name" nowrap><a href="#addCollisionFilterToBody">addCollisionFilterToBody</a>&nbsp;(item)</td>
	<td class="summary">Adds a collision filter from an object to a body.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#addObjectToGroup">addObjectToGroup</a>&nbsp;(displayObject, group)</td>
	<td class="summary">Adds a displayObject to a displayGroup </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#addPropertiesToBody">addPropertiesToBody</a>&nbsp;(body, object)</td>
	<td class="summary">Adds the non-physical properties of an object to a body.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#addSuffixToFileName">addSuffixToFileName</a>&nbsp;(filename, suffix)</td>
	<td class="summary">Adds a suffix to a filename.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#applyPhysicalParametersToBody">applyPhysicalParametersToBody</a>&nbsp;(body, params)</td>
	<td class="summary">Applies physical properties to a body.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#boolToString">boolToString</a>&nbsp;(bool)</td>
	<td class="summary">Converts a boolean value into a string.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#calculateViewpoint">calculateViewpoint</a>&nbsp;(group, x, y)</td>
	<td class="summary">Calculates a viewpoint for a given position.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#clampPosition">clampPosition</a>&nbsp;(x, y, bounds)</td>
	<td class="summary">Clamps a position to within bounds.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#convertFramesToTime">convertFramesToTime</a>&nbsp;(frameCount, fps)</td>
	<td class="summary">Converts a frame count into minutes, seconds and tenths.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#convertStringToBoolSafely">convertStringToBoolSafely</a>&nbsp;(string)</td>
	<td class="summary">Converts a string into a boolean safely.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#convertStringToNumberSafely">convertStringToNumberSafely</a>&nbsp;(string)</td>
	<td class="summary">Converts a string into a number safely.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#copyProperties">copyProperties</a>&nbsp;(objectA, objectB)</td>
	<td class="summary">Copies Properties from one object to another.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#copyPropertiesToObject">copyPropertiesToObject</a>&nbsp;(objectA, objectB, propertiesToIgnore)</td>
	<td class="summary">Copies the Properties of one object to another.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#decodeJsonSafely">decodeJsonSafely</a>&nbsp;(string, strict)</td>
	<td class="summary">Decodes a Json string safely.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#dragObject">dragObject</a>&nbsp;(object, event)</td>
	<td class="summary">Drags an object (something that has an X and Y property).</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#getFilenameFromPath">getFilenameFromPath</a>&nbsp;(path)</td>
	<td class="summary">Extracts a filename from a path.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#getLastDirectoryInPath">getLastDirectoryInPath</a>&nbsp;(path)</td>
	<td class="summary">Gets the last directory in a path.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#getValueFromSeed">getValueFromSeed</a>&nbsp;(value, The)</td>
	<td class="summary">Returns a value from a seed if it exists.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#hexToRGB">hexToRGB</a>&nbsp;(hex)</td>
	<td class="summary">Converts a 6 digit Hex value into its RGB elements.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#isPropertyASeed">isPropertyASeed</a>&nbsp;(value, The)</td>
	<td class="summary">Checks if a property is a Seed.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#loadModuleSafely">loadModuleSafely</a>&nbsp;(moduleName)</td>
	<td class="summary">Safely loads an external module.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#moveObject">moveObject</a>&nbsp;(object, x, y)</td>
	<td class="summary">Moves an object a set distance.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#printTable">printTable</a>&nbsp;(table, indent)</td>
	<td class="summary">Prints out a table to the Console.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#readInConfigFile">readInConfigFile</a>&nbsp;(definition, object)</td>
	<td class="summary">Loads in a config file and copies all the stored properties over to an object.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#readInFileContents">readInFileContents</a>&nbsp;(path)</td>
	<td class="summary">Reads the entire contents of a file into a String.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#readInTable">readInTable</a>&nbsp;(path, baseDirectory)</td>
	<td class="summary">Reads a JSON object from a file and decodes it.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#readLines">readLines</a>&nbsp;(path)</td>
	<td class="summary">Reads the entire contents of a file into a table of lines.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#round">round</a>&nbsp;(number, fudge)</td>
	<td class="summary">Rounds a number.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#saveOutTable">saveOutTable</a>&nbsp;(path, table)</td>
	<td class="summary">Encodes a table into a JSON object and writes it out to a file in the documents directory.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#screenToGridPosition">screenToGridPosition</a>&nbsp;(map, position)</td>
	<td class="summary">Converts a screen position into a tile (grid) position.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#screenToWorldPosition">screenToWorldPosition</a>&nbsp;(map, position)</td>
	<td class="summary">Converts a screen position into a world position </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#showScreenSpaceTiles">showScreenSpaceTiles</a>&nbsp;(map)</td>
	<td class="summary">Makes tiles on screen visible.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#splitString">splitString</a>&nbsp;(str, delim, maxNb)</td>
	<td class="summary">Split a string str in maximum maxNb parts given a delimiter delim.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#stringToBool">stringToBool</a>&nbsp;(s)</td>
	<td class="summary">Converts a string of either "true" or "false" to a boolean value.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#stringToIntTable">stringToIntTable</a>&nbsp;(string, delimiter)</td>
	<td class="summary">Converts a string into a table.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#stripFilenameFromPath">stripFilenameFromPath</a>&nbsp;(path)</td>
	<td class="summary">Strips a filename from a path.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#tableToString">tableToString</a>&nbsp;(table, indent)</td>
	<td class="summary">Converts a table into a string.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#worldToGridPosition">worldToGridPosition</a>&nbsp;(map, position)</td>
	<td class="summary">Converts a world position into a tile (grid) position </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#worldToScreenPosition">worldToScreenPosition</a>&nbsp;(map, position)</td>
	<td class="summary">Converts a world position into a screen position </td>
	</tr>

</table>






<br/>
<br/>




<h2><a name="functions"></a>Functions</h2>
<dl class="function">



<dt><a name="addCollisionFilterToBody"></a><strong>addCollisionFilterToBody</strong>&nbsp;(item)</dt>
<dd>
Adds a collision filter from an object to a body.


<h3>Parameters</h3>
<ul>
	
	<li>
	  item: The item to add the collision filter to.
	</li>
	
</ul>








</dd>




<dt><a name="addObjectToGroup"></a><strong>addObjectToGroup</strong>&nbsp;(displayObject, group)</dt>
<dd>
Adds a displayObject to a displayGroup


<h3>Parameters</h3>
<ul>
	
	<li>
	  displayObject: The object to add.
	</li>
	
	<li>
	  group: The group to add the object to.
	</li>
	
</ul>






<h3>Return value:</h3>
The displayObject



</dd>




<dt><a name="addPropertiesToBody"></a><strong>addPropertiesToBody</strong>&nbsp;(body, object)</dt>
<dd>
Adds the non-physical properties of an object to a body.


<h3>Parameters</h3>
<ul>
	
	<li>
	  body: The body to add the properties to.
	</li>
	
	<li>
	  object: The object that has the properties.
	</li>
	
</ul>








</dd>




<dt><a name="addSuffixToFileName"></a><strong>addSuffixToFileName</strong>&nbsp;(filename, suffix)</dt>
<dd>
Adds a suffix to a filename.


<h3>Parameters</h3>
<ul>
	
	<li>
	  filename: The filename to use.
	</li>
	
	<li>
	  suffix: The suffix to use.
	</li>
	
</ul>






<h3>Return value:</h3>
The new filename.



</dd>




<dt><a name="applyPhysicalParametersToBody"></a><strong>applyPhysicalParametersToBody</strong>&nbsp;(body, params)</dt>
<dd>
Applies physical properties to a body.


<h3>Parameters</h3>
<ul>
	
	<li>
	  body: The body to apply the properties to.
	</li>
	
	<li>
	  params: The physical properties.
	</li>
	
</ul>








</dd>




<dt><a name="boolToString"></a><strong>boolToString</strong>&nbsp;(bool)</dt>
<dd>
Converts a boolean value into a string.


<h3>Parameters</h3>
<ul>
	
	<li>
	  bool: The boolean to convert.
	</li>
	
</ul>






<h3>Return value:</h3>
"true" or "false".



</dd>




<dt><a name="calculateViewpoint"></a><strong>calculateViewpoint</strong>&nbsp;(group, x, y)</dt>
<dd>
Calculates a viewpoint for a given position.


<h3>Parameters</h3>
<ul>
	
	<li>
	  group: The display group.
	</li>
	
	<li>
	  x: The X position for the viewpoint.
	</li>
	
	<li>
	  y: The Y position for the viewpoint.
	</li>
	
</ul>






<h3>Return value:</h3>
The calculated viewpoint.



</dd>




<dt><a name="clampPosition"></a><strong>clampPosition</strong>&nbsp;(x, y, bounds)</dt>
<dd>
Clamps a position to within bounds.


<h3>Parameters</h3>
<ul>
	
	<li>
	  x: The X position to clamp.
	</li>
	
	<li>
	  y: The Y position to clamp.
	</li>
	
	<li>
	  bounds: The bounding box for the clamping. A table with x, y, width and height. X and y are top left corner.
	</li>
	
</ul>






<h3>Return values:</h3>
<ol>
	
	<li>The clamped X position.
	
	<li>The clamped Y position.
	
</ol>



</dd>




<dt><a name="convertFramesToTime"></a><strong>convertFramesToTime</strong>&nbsp;(frameCount, fps)</dt>
<dd>
Converts a frame count into minutes, seconds and tenths. Can be used to display a timer like this -- minutes .. ":" .. seconds .. ":" .. tenths


<h3>Parameters</h3>
<ul>
	
	<li>
	  frameCount: The count of the frames
	</li>
	
	<li>
	  fps: The current fps. Either 30 or 60, will default to 30.
	</li>
	
</ul>






<h3>Return values:</h3>
<ol>
	
	<li>minutes Minute value.
	
	<li>seconds Second value.
	
	<li>tenths  Tenths of second value.
	
</ol>



</dd>




<dt><a name="convertStringToBoolSafely"></a><strong>convertStringToBoolSafely</strong>&nbsp;(string)</dt>
<dd>
Converts a string into a boolean safely.


<h3>Parameters</h3>
<ul>
	
	<li>
	  string: The string to convert.
	</li>
	
</ul>






<h3>Return value:</h3>
The boolean value or the original string if not a boolean.



</dd>




<dt><a name="convertStringToNumberSafely"></a><strong>convertStringToNumberSafely</strong>&nbsp;(string)</dt>
<dd>
Converts a string into a number safely.


<h3>Parameters</h3>
<ul>
	
	<li>
	  string: The string to convert.
	</li>
	
</ul>






<h3>Return value:</h3>
The number value or the original string if not numeric.



</dd>




<dt><a name="copyProperties"></a><strong>copyProperties</strong>&nbsp;(objectA, objectB)</dt>
<dd>
Copies Properties from one object to another.


<h3>Parameters</h3>
<ul>
	
	<li>
	  objectA: The object that has the Properties.
	</li>
	
	<li>
	  objectB: The object that will have the Properties coped to it. Must have an "addProperty" function.
	</li>
	
</ul>








</dd>




<dt><a name="copyPropertiesToObject"></a><strong>copyPropertiesToObject</strong>&nbsp;(objectA, objectB, propertiesToIgnore)</dt>
<dd>
Copies the Properties of one object to another. For adding to an object that doesn't have "addProperty" such as a Sprite.


<h3>Parameters</h3>
<ul>
	
	<li>
	  objectA: The object that has the Properties.
	</li>
	
	<li>
	  objectB: The object that will have the Properties coped to it.
	</li>
	
	<li>
	  propertiesToIgnore: A list of properties to not add if they exist. Optional.
	</li>
	
</ul>








</dd>




<dt><a name="decodeJsonSafely"></a><strong>decodeJsonSafely</strong>&nbsp;(string, strict)</dt>
<dd>
Decodes a Json string safely.


<h3>Parameters</h3>
<ul>
	
	<li>
	  string: The string to decode.
	</li>
	
	<li>
	  strict: If true the string will be decoded without any regard to error checking.
	</li>
	
</ul>






<h3>Return value:</h3>
The decoded value for all proper Json. If there is an error it will append quotes to the string and return the decoded result along with the error.



</dd>




<dt><a name="dragObject"></a><strong>dragObject</strong>&nbsp;(object, event)</dt>
<dd>
Drags an object (something that has an X and Y property).


<h3>Parameters</h3>
<ul>
	
	<li>
	  object: The object to drag.
	</li>
	
	<li>
	  event: The Touch event.
	</li>
	
</ul>








</dd>




<dt><a name="getFilenameFromPath"></a><strong>getFilenameFromPath</strong>&nbsp;(path)</dt>
<dd>
Extracts a filename from a path.


<h3>Parameters</h3>
<ul>
	
	<li>
	  path: The path to use.
	</li>
	
</ul>








</dd>




<dt><a name="getLastDirectoryInPath"></a><strong>getLastDirectoryInPath</strong>&nbsp;(path)</dt>
<dd>
Gets the last directory in a path.


<h3>Parameters</h3>
<ul>
	
	<li>
	  path: The path to use.
	</li>
	
</ul>






<h3>Return value:</h3>
The last directory.



</dd>




<dt><a name="getValueFromSeed"></a><strong>getValueFromSeed</strong>&nbsp;(value, The)</dt>
<dd>
Returns a value from a seed if it exists.


<h3>Parameters</h3>
<ul>
	
	<li>
	  value: 
	</li>
	
	<li>
	  The: value string from Tiled. Should be "seed:seedName".
	</li>
	
</ul>






<h3>Return value:</h3>
The seed value or the passed in value if it is not a seed.



</dd>




<dt><a name="hexToRGB"></a><strong>hexToRGB</strong>&nbsp;(hex)</dt>
<dd>
Converts a 6 digit Hex value into its RGB elements.


<h3>Parameters</h3>
<ul>
	
	<li>
	  hex: The hex value to convert.
	</li>
	
</ul>








</dd>




<dt><a name="isPropertyASeed"></a><strong>isPropertyASeed</strong>&nbsp;(value, The)</dt>
<dd>
Checks if a property is a Seed.


<h3>Parameters</h3>
<ul>
	
	<li>
	  value: 
	</li>
	
	<li>
	  The: value string from Tiled.
	</li>
	
</ul>






<h3>Return value:</h3>
True if it is, false otherwise.



</dd>




<dt><a name="loadModuleSafely"></a><strong>loadModuleSafely</strong>&nbsp;(moduleName)</dt>
<dd>
Safely loads an external module.


<h3>Parameters</h3>
<ul>
	
	<li>
	  moduleName: The name of the module. Ex. "ui"
	</li>
	
</ul>






<h3>Return value:</h3>
The loaded module or nil if none found.



</dd>




<dt><a name="moveObject"></a><strong>moveObject</strong>&nbsp;(object, x, y)</dt>
<dd>
Moves an object a set distance. (something that has an X and Y property)


<h3>Parameters</h3>
<ul>
	
	<li>
	  object: The object to move.
	</li>
	
	<li>
	  x: The amount to move the object along the X axis.
	</li>
	
	<li>
	  y: The amount to move the object along the Y axis.
	</li>
	
</ul>








</dd>




<dt><a name="printTable"></a><strong>printTable</strong>&nbsp;(table, indent)</dt>
<dd>
Prints out a table to the Console.


<h3>Parameters</h3>
<ul>
	
	<li>
	  table: The table to print.
	</li>
	
	<li>
	  indent: Indentation amount. Used for recursive calls.
	</li>
	
</ul>








</dd>




<dt><a name="readInConfigFile"></a><strong>readInConfigFile</strong>&nbsp;(definition, object)</dt>
<dd>
Loads in a config file and copies all the stored properties over to an object.


<h3>Parameters</h3>
<ul>
	
	<li>
	  definition: The value from the Tiled property.
	</li>
	
	<li>
	  object: The object to set the properties on. Must have a setProperty function!
	</li>
	
</ul>








</dd>




<dt><a name="readInFileContents"></a><strong>readInFileContents</strong>&nbsp;(path)</dt>
<dd>
Reads the entire contents of a file into a String.


<h3>Parameters</h3>
<ul>
	
	<li>
	  path: The complete path to the file.
	</li>
	
</ul>






<h3>Return value:</h3>
A string containing the read in contents.



</dd>




<dt><a name="readInTable"></a><strong>readInTable</strong>&nbsp;(path, baseDirectory)</dt>
<dd>
Reads a JSON object from a file and decodes it.


<h3>Parameters</h3>
<ul>
	
	<li>
	  path: The path to the file.
	</li>
	
	<li>
	  baseDirectory: The base directory for the path. Default is system.DocumentsDirectory.
	</li>
	
</ul>






<h3>Return value:</h3>
If successful returns a table with the data from the file. Otherwise returns nil.



</dd>




<dt><a name="readLines"></a><strong>readLines</strong>&nbsp;(path)</dt>
<dd>
Reads the entire contents of a file into a table of lines.


<h3>Parameters</h3>
<ul>
	
	<li>
	  path: The complete path to the file.
	</li>
	
</ul>






<h3>Return value:</h3>
A table of lines with the read in contents.



</dd>




<dt><a name="round"></a><strong>round</strong>&nbsp;(number, fudge)</dt>
<dd>
Rounds a number.


<h3>Parameters</h3>
<ul>
	
	<li>
	  number: The number to round.
	</li>
	
	<li>
	  fudge: A value to add to the number before rounding. Optional.
	</li>
	
</ul>






<h3>Return value:</h3>
The rounded number.



</dd>




<dt><a name="saveOutTable"></a><strong>saveOutTable</strong>&nbsp;(path, table)</dt>
<dd>
Encodes a table into a JSON object and writes it out to a file in the documents directory.


<h3>Parameters</h3>
<ul>
	
	<li>
	  path: The path to the new file.
	</li>
	
	<li>
	  table: The table to save.
	</li>
	
</ul>








</dd>




<dt><a name="screenToGridPosition"></a><strong>screenToGridPosition</strong>&nbsp;(map, position)</dt>
<dd>
Converts a screen position into a tile (grid) position.


<h3>Parameters</h3>
<ul>
	
	<li>
	  map: The current Map.
	</li>
	
	<li>
	  position: The screen position.
	</li>
	
</ul>






<h3>Return value:</h3>
The grid position.



</dd>




<dt><a name="screenToWorldPosition"></a><strong>screenToWorldPosition</strong>&nbsp;(map, position)</dt>
<dd>
Converts a screen position into a world position


<h3>Parameters</h3>
<ul>
	
	<li>
	  map: The current Map.
	</li>
	
	<li>
	  position: The screen position.
	</li>
	
</ul>






<h3>Return value:</h3>
The world position.



</dd>




<dt><a name="showScreenSpaceTiles"></a><strong>showScreenSpaceTiles</strong>&nbsp;(map)</dt>
<dd>
Makes tiles on screen visible. Sets tiles that are just off screen to be invisible and those on screen to be visible.


<h3>Parameters</h3>
<ul>
	
	<li>
	  map: The current Map.
	</li>
	
</ul>




<h3>Usage:</h3>
If your application has a lot of sprites that end up off screen then it may benefit from calling this function either on a per frame basis or when moving the camera/grid.





</dd>




<dt><a name="splitString"></a><strong>splitString</strong>&nbsp;(str, delim, maxNb)</dt>
<dd>
Split a string str in maximum maxNb parts given a delimiter delim. from http://lua-users.org/wiki/SplitJoin - added  case "" for delim to split the str in array of chars.


<h3>Parameters</h3>
<ul>
	
	<li>
	  str: String to split.
	</li>
	
	<li>
	  delim: Delimiter to split on.
	</li>
	
	<li>
	  maxNb: Maximum number of split parts. Optional.
	</li>
	
</ul>






<h3>Return value:</h3>
- Array of string-parts that were found during the split.



</dd>




<dt><a name="stringToBool"></a><strong>stringToBool</strong>&nbsp;(s)</dt>
<dd>
Converts a string of either "true" or "false" to a boolean value. Case insensitive.


<h3>Parameters</h3>
<ul>
	
	<li>
	  s: The string to convert.
	</li>
	
</ul>






<h3>Return value:</h3>
True or False based on the input string.



</dd>




<dt><a name="stringToIntTable"></a><strong>stringToIntTable</strong>&nbsp;(string, delimiter)</dt>
<dd>
Converts a string into a table.


<h3>Parameters</h3>
<ul>
	
	<li>
	  string: The string to convert.
	</li>
	
	<li>
	  delimiter: What the string should be split on.
	</li>
	
</ul>






<h3>Return value:</h3>
table The converted table.



</dd>




<dt><a name="stripFilenameFromPath"></a><strong>stripFilenameFromPath</strong>&nbsp;(path)</dt>
<dd>
Strips a filename from a path.


<h3>Parameters</h3>
<ul>
	
	<li>
	  path: The path to use.
	</li>
	
</ul>






<h3>Return value:</h3>
The stripped path.



</dd>




<dt><a name="tableToString"></a><strong>tableToString</strong>&nbsp;(table, indent)</dt>
<dd>
Converts a table into a string.


<h3>Parameters</h3>
<ul>
	
	<li>
	  table: The table to convert.
	</li>
	
	<li>
	  indent: Indentation amount. Used for recursive calls.
	</li>
	
</ul>






<h3>Return value:</h3>
string The converted string.



</dd>




<dt><a name="worldToGridPosition"></a><strong>worldToGridPosition</strong>&nbsp;(map, position)</dt>
<dd>
Converts a world position into a tile (grid) position


<h3>Parameters</h3>
<ul>
	
	<li>
	  map: The current Map.
	</li>
	
	<li>
	  position: The world position.
	</li>
	
</ul>








</dd>




<dt><a name="worldToScreenPosition"></a><strong>worldToScreenPosition</strong>&nbsp;(map, position)</dt>
<dd>
Converts a world position into a screen position


<h3>Parameters</h3>
<ul>
	
	<li>
	  map: The current Map.
	</li>
	
	<li>
	  position: The world position.
	</li>
	
</ul>






<h3>Return value:</h3>
The screen position.



</dd>


</dl>







</div> <!-- id="content" -->

</div> <!-- id="main" -->

<div id="about">
	<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->	
</body>
</html>
